home *** CD-ROM | disk | FTP | other *** search
- Path: dispatch.news.demon.net!demon!thesett.demon.co.uk
- From: Andy@thesett.demon.co.uk (Andy Goodwin)
- Newsgroups: comp.lang.c
- Subject: Re: IDE HardDrive Serial Number??
- Date: Sun, 18 Feb 1996 17:41:17 GMT
- Message-ID: <3127645c.751054@news.demon.co.uk>
- References: <3102f286.115207123@news.onramp.net>
- NNTP-Posting-Host: thesett.demon.co.uk
- X-NNTP-Posting-Host: thesett.demon.co.uk
- X-Newsreader: Forte Agent .99c/16.141
-
- On Mon, 22 Jan 1996 02:13:36 GMT, redbaron@onramp.net (Ronnie Moller,
- Jr.) wrote:
-
- >I am trying to get the information off an IDE HardDrive, for example
- >the Serial number, and the manufactures model number. If some one
- >could point me in the write direction, I would appreciate it.
- >
- >Ronnie
-
-
-
- MOV AH,0D ; Code will load at 0100h
- MOV DL,80
-
- INT 13 ; reset hard disk system
- MOV AX,0000 ; issue specify drive 0
-
- MOV DX,01F6 ; command to SDH port
- OUT DX,AL
- MOV AL,EC ; issue identify drive
- MOV DX,01F7 ; command to
- OUT DX,AL ; command port
-
- ; wait a second
-
- MOV AX,0000 ; isSue specify drive 0
- MOV DX,01F6 ; command to SDH port
- OUT DX,AL
- MOV AX,00E4 ; issue read sector buffer
- OUT DX,AL ; command
-
-
- ; wait a second
-
- CLD
- MOV AX,CS i set up ES:DI to point to
- MOV ES,AX ; current code segment and
- MOV DI,0200 ; offset 0200h for data
- MOV CX,0100 ; loop counter 0100h
- MOV DX,01F0 ; set up data port value
- ; address 0130h
-
- IN AX,DX ; read word-wide port
- IN AX,DX ; read word-wide port
- STOSW ; Store in data area at
- LOOP 0130 ; loop for all lOOh words
-
- ; wait a second
-
- MOV AX,0D00 ; Reset disk system
- MOV DX,0080
- INT 13
-
- ; wait a second
-
-
-